package com.project.frame.common.utils;


import com.project.frame.common.constant.SystemConstants;

/**
 * 
 * @description：组装缓存key
 */
public class CacheKeyUtils {
	/**
	 * 组装缓存key
	 * @param item1 
	 * @param item2 
	 * @return
	 */
	public static synchronized String getKey(Object item1, Object item2) {
		StringBuffer sb = new StringBuffer();
		sb.append(item1).append(SystemConstants.COLON_SEPARATOR).append(item2);
		return sb.toString();
	}
	
	/**
	 * 组装缓存key
	 * @param item1 
	 * @param item2    
	 * @param item3    
	 * @return
	 */
	public static synchronized String getKey(Object item1, Object item2, Object item3) {
		StringBuffer sb = new StringBuffer();
		sb.append(item1).append(SystemConstants.COLON_SEPARATOR).append(item2).append(SystemConstants.COLON_SEPARATOR).append(item3);
		return sb.toString();
	}
	
	/**
	 * 组装缓存key
	 * 
	 * @param item1
	 * @param item2
	 * @param item3
	 * @param item4
	 * @return
	 */
	public static String getKey(Object item1, Object item2, Object item3, Object item4) {
		StringBuffer sb = new StringBuffer();
		sb.append(item1).append(SystemConstants.COLON_SEPARATOR).append(item2).append(SystemConstants.COLON_SEPARATOR).append(item3)
				.append(SystemConstants.COLON_SEPARATOR).append(item4);
		return sb.toString();
	}
}
